package org.zhb.sys.shiro.model;

import java.io.Serializable;
import javax.persistence.*;

import org.hibernate.annotations.DynamicUpdate;
import org.hibernate.annotations.GenericGenerator;

import com.fasterxml.jackson.annotation.JsonIgnore;

import java.util.Date;

/**
 * The persistent class for the s_role_function database table.
 * 
 */
@Entity
@Table(name = "s_role_function")
@NamedQuery(name = "RoleFunction.findAll", query = "SELECT r FROM RoleFunction r")
@DynamicUpdate(true)
public class RoleFunction implements Serializable {
	private static final long serialVersionUID = 1L;

	@Id
	@Column(unique = true, nullable = false, length = 32)
	@GeneratedValue(generator = "uuid")
	@GenericGenerator(strategy = "uuid", name = "uuid")
	private String id;

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "operate_time")
	private Date operateTime;

	// bi-directional many-to-one association to Role
	@ManyToOne
	@JoinColumn(name = "role_id")
	private Role Role;

	// bi-directional many-to-one association to Function
	@ManyToOne
	@JoinColumn(name = "function_id")
	private Function Function;

	public RoleFunction() {
	}

	public String getId() {
		return this.id;
	}

	public void setId(String id) {
		this.id = id;
	}

	public Date getOperateTime() {
		return this.operateTime;
	}

	public void setOperateTime(Date operateTime) {
		this.operateTime = operateTime;
	}
	@JsonIgnore
	public Role getRole() {
		return this.Role;
	}

	public void setRole(Role Role) {
		this.Role = Role;
	}

	public Function getFunction() {
		return this.Function;
	}

	public void setFunction(Function Function) {
		this.Function = Function;
	}

}